export const useAppStore = defineStore('App', {
  state: () => {
    return {
      theme: 'dark',
    }
  },
  getters: {
    
  },
  actions: {
    changeTheme(theme: string) {
      this.theme = theme
    },
  },
  /* 持久化设置 */
  /* 启动localStorage本地存储 但是这样服务端就拿不到 只有客户端可以拿到  */
  persist: {
    storage: piniaPluginPersistedstate.cookies(),
    /* cookie */
    // cookieOptions: {
    //   sameSite: 'lax',
    // },
  },
})

if (import.meta.hot) {
    import.meta.hot.accept(acceptHMRUpdate(useAppStore, import.meta.hot))
}